<?php

include_once("model/common.php");



//这里必须要openid
//$openid               = $_REQUEST['openid'];

//发送消息模板的地址
$url = "http://yitong.zhihuitiangong.com/api/wechat_mp/send_message_model.php";

//消息模板跳转的地址
$go_url = "http://oa.enpingshi.com/front/employee_center/view/task_detail.php?openid=".$openid;
//如果有定义跳转地址
if($custom_url){
    $go_url  = $custom_url;
}else{
    $go_url  = $go_url;
}

$post_data = array(
    "touser"=>$openid, //推送给谁,openid  
    //"touser"=>'oUaqG0dZdR4ITehiwDOLoCxcn49w', //推送给工作号
    "template_id"=>"1DqGzhxUzmy-qr6FXIbYjYoRAF8WAQV9t2WuKzn0B5w", //微信后台的模板信息id
    "url"=> $go_url, //
    "data"=> array(
        "first" => array(
            "value"=>"您负责的任务有信息有变动，请查阅",
            "color"=>"#173177"
        ),
        "keyword1"=>array(
            "value"=>date("Y-m-d"),//时间
            "color"=>"#173177"
        ),

        "keyword2"=>array(
            "value"=>$tip,
            "color"=>"#173177"
        ),
        "remark"=> array(
            "value"=>"请登录系统查看详情；",
            "color"=>"#173177"
        ),
    )
);

    $sql_data = serialize($post_data);
    $data['content'] = $sql_data;
    $re_back = send_wx_sms($url , $data);
    $re_back_arr = json_decode($re_back, true);
?>

